<form class="example-form">
  <mat-form-field class="example-full-width">
    <mat-label>Email</mat-label>
    <input type="email" matInput [formControl]="emailFormControl" placeholder="Ex. pat@example.com">
    @if (emailFormControl.hasError('email') && !emailFormControl.hasError('required')) {
      <mat-error>Please enter a valid email address</mat-error>
    }
    @if (emailFormControl.hasError('required')) {
      <mat-error>Email is <strong>required</strong></mat-error>
    }
  </mat-form-field>
</form>
